"""djangoProject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url,include
from django.contrib import admin
from app01 import views
from app01 import urls as app01_urls
from app02 import urls as app02_urls

urlpatterns = [
    url(r'^admin/', admin.site.urls),

    # 写自己的路由与视图函数对应关系
    url(r'^index/', views.index),
    url(r'^login/', views.login),
    url(r'^reg/', views.reg),
    url(r'^userlist/', views.userlist),
    url(r'^edit/', views.edit),
    url(r'^delete/', views.delete),

    # 路由分发
    # 只要url开头是对应开头，就回交给对应应用路由处理
    url(r'^app01/', include(app01_urls)),
    url(r'^app02/', include(app02_urls)),

    # 序列化
    url(r'^serialize/',views.serialize),

    # 文件上传
    url(r'^upload/',views.upload),

    # django序列化组件
    url(r'^ab_json/',views.ab_json),

    # 批量插入
    url(r'^batch_insert/',views.batch_insert)
]